package cn.wolfcode.shop.service.impl;

import cn.wolfcode.shop.domain.Good;
import cn.wolfcode.shop.mapper.GoodServiceMapper;
import cn.wolfcode.shop.service.IGoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;

import java.util.List;
import java.util.Set;

@Service
public class GoodServiceImpl implements IGoodService{

    @Autowired
    private GoodServiceMapper goodServiceMapper;

    @Override
    public List<Good> getGoodListByIds(Set<Long> ids) {
        if (CollectionUtils.isEmpty(ids))
            // 如果 ids 没有数据，就不需要进入mapper中
            return null;

        return goodServiceMapper.selectGoodListByIds(ids);
    }
}
